package edu.utdallas.rxs104020;

public class QueueElement implements Comparable<QueueElement> {

	private int id;
	private int timeStamp;

	public QueueElement(int id, int timeStamp) {
		this.id = id;
		this.timeStamp = timeStamp;
	}

	public int getId() {
		return id;
	}

	public int getTimeStamp() {
		return timeStamp;
	}

	public int compareTo(QueueElement arg0) {
		if (this.timeStamp < arg0.getTimeStamp()) {
			return -1;
		} else if (this.timeStamp == arg0.getTimeStamp()) {
			if (this.id < arg0.getId()) {
				return -1;
			} else {
				return 1;
			}
		} else {
			return 1;
		}
	}

}
